/***********************************************************************
 * Module:  PPTBuilder.java
 * Author:  wuxinyang
 * Purpose: Defines the Class PPTBuilder
 ***********************************************************************/

package com.witframework.plugin.lucene.extractor;

import java.io.InputStream;

import org.apache.poi.hslf.extractor.PowerPointExtractor;

import com.witframework.plugin.lucene.DocumentHandlerException;



/** @pdOid 20463410-6672-4e6b-ad1d-636aa2728857 */
public class PptTextExtractor implements InputStreamTextExtractor{
	public String getContents(InputStream is) {
		String contents = null;
		try {
			PowerPointExtractor ppe = new PowerPointExtractor(is);
			contents = ppe.getText();
		} catch (Exception e) {	throw new DocumentHandlerException(
					"Cannot extract text from a ppt document", e);
		}
		return contents;
	}
}